<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;
class Area extends Model
{
    protected $table="area";
    
    protected $primaryKey = 'area_id';
    
    protected $fillable = ['area_id','title','pid','sort'];
    
    public  $timestamps = false;
    
    public function parentArea()
    {
        return $this->belongsTo('App\Models\Area', 'pid', 'area_id');
    }
    
    public function childrenAreas()
    {
        return $this->hasMany('App\Models\Area', 'pid', 'area_id');
    }
}
